POV-Ray : Newsgroups : povray.unofficial.patches : Macros, includes and memory management : Re: Macros, includes and memory management Server Time
1 Sep 2024 18:17:27 EDT (-0400)
  Re: Macros, includes and memory management  
From: Geoff Wedig
Date: 19 Dec 2000 10:03:57
Message: <3a3f78dd@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:

> In article <3a3f589f@news.povray.org>, Geoff Wedig 
> <wed### [at] darwinepbicwruedu> wrote:

>> So, any of you Megapov gurus got any ideas?  I this this is an 
>> unsolveable limitation in the program, but maybe someone else has 
>> found a way around it. 

> Instead of defining a macro inside of another, change the value of a 
> global variable and put all your macros in the file, with different 
> names. Then, have the macro that you called(the one that was originally 
> defined inside the other macro) decide what to do based on that 
> variable. Probably the best way would be to use the #switch statement to 
> call the desired macro.

That's probably what I'll have to do.  It's not very extensible though.  If
someone wants to use their own parameterization, that isn't provided in the
base code, they have to not only write the new macro, but give it an
identifier and add it to the multiplexer macro.  Of course, I could write
some code that would add something to the multiplexer macro.... That could
even be an include rather than a macro itself, so could be done.

Hmm, can a macro be defined in terms of itself?  Ie, can you have something
like:

#macro test_macro()

  test_macro()

  other stuff
#end

?

I'll test...

Anyway, I'm back in business.  Thanks!

Geoff


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.